Removed unnecessary variables and moved scanning button into container